package com.vichat.online.service;

import com.vichat.online.entity.OnlineUserDLog;
import com.vichat.online.entity.OnlineUserMLog;
import com.vichat.online.entity.StatOnlineUser;

import java.util.HashMap;
import java.util.List;

public interface IOnlineService {
    public HashMap<Long, StatOnlineUser> initOnlineUser();
    public void saveStatOnlineUser(StatOnlineUser newStatOnlineUser) throws Exception;
    public void dealUserOffline(StatOnlineUser statOnlineUser) throws Exception;
    /**
     * 在线时长当日表数据生成
     * @param today
     */
    public void processOnlineUserLog(String today);
    /**
     * 在线时长月表数据生成
     * @param yesterDayMonth
     * @param yesterDay
     */
    public void processOnlineUserMLog(String yesterDayMonth,String yesterDay);

    /**
     * 检查在线时长月表数据是否生成
     * @param yesterDayMonth
     * @param yesterDay
     */
    public boolean isExistOnlineUserMLog(String yesterDayMonth,String yesterDay);

    /**
     * 获取人员在线时长当天排行榜
     * @return
     * @throws Exception
     */
    public List<OnlineUserMLog> getOnlineUserMLogDayReport(long partyId) throws Exception;

    /**
     * 获取人员在线时长本周排行榜
     * @return
     * @throws Exception
     */
    public List<OnlineUserMLog> getOnlineUserMLogWeekReport(long partyId) throws Exception;

    /**
     * 获取人员在线时长本月排行榜
     * @return
     * @throws Exception
     */
    public List<OnlineUserMLog> getOnlineUserMLogMonthReport(long partyId) throws Exception;

    /**
     * 获取人员在线时长详情
     * @param onlineType
     * @param time
     * @param uid
     * @param partyId
     * @param page
     * @param rows
     * @return
     * @throws Exception
     */
    public List<OnlineUserMLog> getUserOnlineDetail(long onlineType, String time, long uid, long partyId, int page, int rows) throws Exception;

    /**
     * 获取人员在线时长总数
     * @param onlineType
     * @param time
     * @param uid
     * @param partyId
     * @return
     * @throws Exception
     */
    public long getUserOnlineDetailCount(long onlineType, String time, long uid, long partyId) throws Exception;

    /**
     * 获取用户日时长明细
     * @param uid
     * @return
     * @throws Exception
     */
    public List<OnlineUserDLog> getOnlineUserDLogByUid(long uid, String time) throws Exception;

    /**
     * 获取用户月时长明细
     * @param uid
     * @return
     * @throws Exception
     */
    public List<OnlineUserMLog> getOnlineUserMLogByUid(long uid, String time) throws Exception;
}
